import ActionGroup from "./ActionGroup.vue"
import moment from "moment";
/**
 * tooltip {boolean}  
 */
const columns = (showOperate) => {
  let arr = [
    // {
    //   type: 'selection',
    //   width: 55
    // },
    {
      label: 'ID',
      prop: 'taskId',
      // width: 130,
      tooltip: false,
    },
    {
      label: 'Alarm Name',
      prop: 'alarmName',
      // width: 120,
      tooltip: false,
    },
    {
      label: 'Algorithm',
      prop: 'algorithmName',
      // width: 120,
      tooltip: true,
    },
    {
      label: 'Location',
      prop: 'location',
      // width: 120,
      tooltip: false,
    },
    {
      label: 'Camera',
      prop: 'camera',
      tooltip: false,
    },
    {
      label: 'Time',
      prop: 'time',
      // width: 160,
      tooltip: false,
      formatter: (row, column, cellValue, index) => {
        return <span>{row.time ? moment(row.time).format('yyyy-MM-DD HH:mm:ss') : ''}</span>
      }
    },
    {
      label: 'Attribution',
      prop: 'attribution',
      // width: 120,
      tooltip: true,
    },
  ]
  if (showOperate) {
    arr.push({
      label: "Operate",
      width: 180,
      render: ActionGroup
    })
  }
  return arr;
};
export default columns;